package StringBuffer_;

/**
 * @description:
 * @Author yyp
 * @time
 */
public class StringBufferExercise01 {
    public static void main(String[] args) {
        String st = null;
        //System.out.println(st.length());，会报空指针异常，没有数据
        StringBuffer sb = new StringBuffer();
        sb.append(st);
        //调用以下方法private AbstractStringBuilder appendNull()
        System.out.println(sb);
        System.out.println(sb.length());

        //StringBuffer sb1 = new StringBuffer(st);
        //报空指针异常，看底层源码 super(str.length() + 16);
        //System.out.println(sb1);
    }
}
